package hn.cch.client.controller;


import hn.cch.common.entity.ExchangeRecord;
import hn.cch.common.exchange.ExchangeInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping(value = "/exchange")
@RestController
public class ExchangeController {

    private static final Logger logger = LoggerFactory.getLogger(ExchangeController.class);

    @Autowired
    public ExchangeInterface exchangeInterface;

    @GetMapping(value = "/{uuid}")
    public ExchangeRecord getExchangeRecord(@PathVariable(value = "uuid") String uuid) {
        logger.info("uuid:{}", uuid);
        return exchangeInterface.getExchangeRecord(uuid);
    }

}
